import request from '@/utils/request'

// 新增烟草证绑定
export function addYancao(query) {
  return request({
    url: '/trwxuser/user/backgroundAdd',
    method: 'post',
    data:query
  })
}
// 解绑烟草证
export function jiebang(query) {
  return request({
    url: '/trwxuser/user/delectTobaccoNumber/'+query,
    method: 'get'
  })
}
// 批量修改积分
export function changeScore(data){
  return request({
    url: '/membernumber/membernumber/BatchAdd',
    method: 'post',
    data: data
  })
}

// 查询会员列表
export function listMember(query) {
  return request({
    url: '/member/member/list',
    method: 'get',
    params: query
  })
}

// 查询会员详细
export function getMember(id) {
  return request({
    url: '/member/member/' + id,
    method: 'get'
  })
}
// 获取绑定品牌列表
export function getBindingList(id) {
  return request({
    url: '/member/member/memberIdQueryBrandCard/' + id,
    method: 'get'
  })
}
// 新增会员
export function addMember(data) {
  return request({
    url: '/member/member',
    method: 'post',
    data: data
  })
}
// 新增会员品牌会员卡绑定
export function binding(data) {
  return request({
    url: '/membershipcard/membershipcard/membershipcardsave/'+data.id,
    method: 'post',
    data: data.cardIds.map(item=>item+'')
  })
}
export function bindingIdcard (data){
  return request({
    url: '/wxuser/modifyidcard',
    method: 'put',
    data: data,
    isHideToken:true
  })
}
// 修改会员
export function updateMember(data) {
  return request({
    url: '/wxuser/adminupdate',
    method: 'put',
    data: data
  })
}

// 删除会员
export function delMember(id) {
  return request({
    url: '/member/member/' + id,
    method: 'delete'
  })
}

// 导出会员
export function exportMember(query) {
  return request({
    url: '/member/member/export',
    method: 'get',
    params: query
  })
}